/*
 * Copyright (c) 2018. 玺得（深圳）科技有限公司.保留所有权利. http://www.pi-top.com/ 玺得（深圳）科技有限公司保留所有代码著作权.如有任何疑问请访问官方网站与我们联系. 代码只针对特定需求定制编码，不得在未经允许或授权的情况下对外传播扩散.恶意传播者，法律后果自行承担. 本代码仅用于pps-cloud系统.
 */
package com.pitop.sync.api;

import com.pitop.box.entity.Box;
import com.pitop.customer.entity.Customer;
import com.pitop.order.entity.Order;
import com.pitop.test.entity.TestRecord;
import com.pitop.test.entity.TestUnit;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 同步数据 api请求熔断器
 *
 * @author pi-top
 */
@FeignClient(value = "pps-cloud-provider", fallback = SyncDataTraceFeignApiImpl.class)
public interface SyncDataTraceFeignApi {

    /**
     * 从工厂端往云端同步数据
     *
     * @param testUnitList 数据集合
     * @return true/false
     */
    @RequestMapping(value = "/syncDataTrace/upwardsSyncTestUnit")
    boolean upwardsSyncTestUnit(@RequestBody List<TestUnit> testUnitList);

    /**
     * 从工厂端往云端同步测试件记录数据
     *
     * @param testRecordList 数据集合
     * @return true/false
     */
    @RequestMapping(value = "/syncDataTrace/upwardsSyncTestRecord")
    boolean upwardsSyncTestRecord(@RequestBody List<TestRecord> testRecordList);

    /**
     * 从工厂端往云端同步箱体数据
     *
     * @param boxList 数据集合
     * @return true/false
     */
    @RequestMapping(value = "/syncDataTrace/upwardsSyncBox")
    boolean upwardsSyncBox(@RequestBody List<Box> boxList);

    /**
     * 从工厂端往云端同步用户数据
     *
     * @param customerList 数据集合
     * @return true/false
     */
    @RequestMapping(value = "/syncDataTrace/upwardsSyncCustomer")
    boolean upwardsSyncCustomer(@RequestBody List<Customer> customerList);

    /**
     * 从工厂端往云端同步订单数据
     *
     * @param orderList 数据集合
     * @return true/false
     */
    @RequestMapping(value = "/syncDataTrace/upwardsSyncOrder")
    boolean upwardsSyncOrder(@RequestBody List<Order> orderList);

}
